namespace NConfigGeneratorUI
{
    public sealed class Sample
    {
        private readonly string _name;
        private readonly string _content;

        public Sample(string name, string content)
        {
            _name = name;
            _content = content;
        }

        public string Name
        {
            get { return _name; }
        }

        public string Content
        {
            get { return _content; }
        }

        public override string ToString()
        {
            int lastDot = _name.LastIndexOf('.', _name.Length - ".xml".Length - 1);
            return lastDot < 0 ? _name.Substring(0, _name.Length - ".xml".Length) : _name.Substring(lastDot + 1, _name.Length - ".xml".Length - lastDot - 1);
        }
    }
}